<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
?><!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="/ui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="/ui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="/static/plugin/font-awesome/css/font-awesome.min.css">
<script language="javascript" src="/static/js/jquery-1.10.2.min.js"></script>
<script language="javascript" src="/ui/jquery.easyui.min.js"></script>
<style type="text/css">
a{text-decoration:none;color:#333;}
.easyui-tree li{margin:10px 0px;}
.easyui-tree li a{text-decoration:none;color:#000;}
.tit{height:30px;}
.logo{float:left;margin:6px 0px 0px 5px;}
.ctrl{float:right;margin:9px 20px 0px 0px;}
.ctrl .easyui-menubutton{margin-left:30px;font-weight:bold;}
.header{background:#E0ECFF;border-top:0px;height:50px;visibility:hidden;}
</style>
</head>
<body>
<div class="easyui-layout" fit="true">
	<div data-options="region:'north',split:true,collapsible:false" class="header">
		<div>
			<div class="logo"><img src="/static/admin/images/logo.png" height="30"></div>
			<div class="ctrl">
				<a href="/" target="_blank" class="easyui-linkbutton" iconCls="icon-home">网站首页</a>
				<a href="javascript:alert('清理成功');" class="easyui-linkbutton" iconCls="icon-clear">清理缓存</a>
				<a href="javascript:void(0)" id="mb" class="easyui-menubutton"     
				        data-options="menu:'#mm',iconCls:'icon-user'"><?php echo $this->session->admin_name;?></a>   
				<div id="mm" style="width:150px;">   
				    <div data-options="iconCls:'icon-edit'"><a href="#" onclick="dopwd()" style="width:auto;">修改密码</a></div>   
				    <!-- div class="menu-sep"></div>  -->
				    <div data-options="iconCls:'icon-logout'"><a href="<?php echo site_url('login/log_out');?>" style="width:auto;">退出</a></div>   
				</div>  
			</div>
			<div class="clear"></div>
		</div>
	</div>
	<div data-options="region:'west',split:true,width:'12%',title:'功能列表',loadingMessage:'请稍候，加载中...'">
		<div class="easyui-accordion left-menu" border="false" fit="true" style="visibility:hidden;">
			
<?php
foreach ($admin_ower as $v) {
?>			<div title="<?php echo $v['name'];?>" iconCls="<?php echo $v['icon'];?>">
				<ul class="easyui-tree">
					
<?php
	foreach ($v['child'] as $v1) {
?>					<li iconCls="icon-arrow-right"><a href="#" data-url="<?php echo $v1['url'];?>"><?php echo $v1['name'];?></a></li>
					<?php
	}

?>				</ul>
			</div>
			<?php
}

?>		</div>
	</div>
	<div data-options="region:'center',split:true,width:'88%',border:false">
		<div class="easyui-tabs" id="center"  fit="true">
		<div title="后台首页" iconCls="icon-home">
			<div class="easyui-panel" data-options="border:false" href="<?php echo site_url('home/center');?>" ></div>
		</div>
		</div>
	</div>
	<div data-options="region:'south',split:true" style="height:30px;"><div style="background:#E0ECFF;text-align:center;padding-top:3px;">当前版本：v1.0</div></div>
</div>
</body>
</html>

<script language="javascript">
	function dopwd(){
		$('body').append('<div id="header_win"></div>');

		$('#header_win').window({
			width:400,
			height:200,
			modal:true,
			closed:true
		});
		
		$('#header_win').window({'title':'修改密码'});
		$('#header_win').window('open');
		$('#header_win').window('refresh', '<?php echo site_url('webmasters/password');?>');
	}
</script>
<script type="text/javascript">
$(function(){
	 $('.left-menu [data-url]').on('click',function(){
		var title = $(this).text();
		var url = $(this).attr('data-url');
		var icon = $(this).attr('data-icon');

		if ($('#center').tabs('exists', title)){
			$('#center').tabs('select', title);
		} else {
			var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';
			$('#center').tabs('add',{
				title:title,
				content:content,
				closable:true,
				icon:icon
			});
		}
	});
	$('.left-menu').css('visibility','visible');
	$('.header').css('visibility','visible');
});
</script>